<!--
Variables set for this template:
  greeting:  Text to display as startup status
  bowls:     List of bowls; see bowl.py for format
  choices:   Dict of bowl_id -> team_id
  is_admin:  True if user is logged in and is an admin
-->
<html>
  <head>
    <link type="text/css" rel="stylesheet" href="/static/choose.css" />
    <script src="/static/choose.js"></script>
  </head>
  <body>
    <p><div id="status">{{ greeting }}</div></p>
    <table>
      {% for bowl in bowls %}
      <tr id="{{ bowl[1] }}">
        <td>{{ bowl[0][5:] }}</td>
        <td>{{ bowl[4] }}</td>
        <td id="{{ bowl[2] }}"
            class="{{ 'selected' if choices.get(bowl[1]) == bowl[2] }}"
            onclick="clickTeam(this, '{{ '/admin/save' if is_admin else '/player/save' }}')"
            onmouseover="this.style.cursor='pointer'">
          {{ bowl[5] }}
        </td>
        <td id="{{ bowl[3] }}"
            class="{{ 'selected' if choices.get(bowl[1]) == bowl[3] }}"
            onclick="clickTeam(this, '{{ '/admin/save' if is_admin else '/player/save' }}')"
            onmouseover="this.style.cursor='pointer'">
         {{ bowl[6] }}
        </td>
      </tr>
      {% endfor %}
    </table>
    {% if is_admin %}
    <form action="/admin/update" method="post">
      <input type="submit" value="Update">
    </form>
    {% endif %}
  </body>
</html>
